<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        [v-cloak]{
            display: none;
        }
    </style>
</head>
<body>
    <div id="app">
        <button v-on:click="add" v-cloak>{{msg}}</button>
        <br>
        <router-link to='login'v-cloak>{{msg}}</router-link>
        <!-- <router-link to='/login' >登录</router-link> -->
        <router-view></router-view>
    </div>
    <script src="./lib/vue-2.4.0.js"></script>
    <script src = "./lib/vue-router-3.0.1.js"></script>
    <script>
        var login  ={
            template:'<h1>123</h1>'
        }
        var router = new VueRouter({
            routes:[
                {path:'/login',component:login}
            ]
        })
        var vm = new Vue({
            el:'#app',
            data:{
                msg:1,
            },
            methods:{
                add:function(){
                    this.msg +=1
                }
            },
            router
        })
    </script>
</body>
</html>